<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录页面</title>
    <link rel="stylesheet" href="./iconfont/iconfont.css">
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px;
            background-color: rgb(0, 140, 255);
            color: white;
            font-size: 18px
        }
        .content{
            display: flex;
        }
        .content .left {
            background-color: rgb(0, 140, 255);
            color: white;
            width: 100px;
            text-align: center;
            line-height: 60px;
            height: 700px;
        }
        .content .left .active{
            background-color: rgb(166, 223, 147);
        }
        .content .right{
            flex: 1;
            margin-left: 30px;
        }
        .content .right input{
            margin-top: 50px;
            outline: none;
            border: 1px solid gray;
            width: 200px;
            height: 40px;
            line-height: 30px;
            border-radius: 15px;
            padding-left: 10px;
        }
        .content .right button{
            width: 100px;
            border: 1px solid gray;
            border-radius: 10px;
            height: 40px;
            background-color: rgb(70, 163, 64);
            color:white 
        }
        .content .right .add{
            width: 150px;
            height: 40px;
            border: 1px solid gray;
            background-color: rgb(70, 163, 64);
            color:white;
            margin-top: 20px;
            border-radius: 10px;
            text-align: center;
            line-height: 40px;
        }

        .content .right table{
            width: 900px;
            line-height: 40px;
            border-collapse: collapse;
            
        }
        .content .right table tbody{
            text-align: center;
        }
        .content .right table tbody td{
            border-top: 1px solid gray;
        }
        .content .right table .email{
            text-align: left;
        }
        .content .right table tbody .statusok{
            height: 30px;
            display: block;
            color: white;
            background-color: rgb(70, 163, 64) ;
            border-radius: 10px;
            line-height: 30px;
        }
        .content .right .foot{
            display: flex;
            margin-top: 20px;
        }
        .content .right .foot .prev{
            display: block;
            width: 150px;
            height: 30px;
            border: 1px solid gray;
            border-radius: 10px;
            line-height: 30px;
            text-align: center;
            margin-left: 400px;
        }
        .content .right .foot .next{
            display: block;
            width: 150px;
            height: 30px;
            border: 1px solid gray;
            border-radius: 10px;
            line-height: 30px;
            text-align: center;
            margin-left: 50px;
        }
    </style>
</head>

<body>
    <div class="top">
        <span>9466云专题</span>
        <span class="iconfont icon-yonghu
        ">龙猫（9466云专题）</span>
    </div>
    <div class="content">
        <div class="left">
            <div class="iconfont icon-home
            ">首页</div>
            <div class="iconfont icon-zhuantiguanli
            " >专题</div>
            <div class="active iconfont icon-yonhu
            ">用户</div>
            <div class="iconfont icon-shezhi
            ">设置</div>
            <div class="iconfont icon-xitongrizhi
            ">日志</div>
        </div>
        <div class="right">
            <input type="text" placeholder="搜索用户">
            <button>搜索</button>
            <div class="add">+ 添加用户</div>
            <table>
                <thead>
                    <tr>
                        <th class="first">邮箱(用户)</th>
                        <th>姓名</th>
                        <th>电话</th>
                        <th>所属组</th>
                        <th>管理员</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="email">123123123@qq.com</td>
                        <td>李彦慧</td>
                        <td>13611129070</td>
                        <td>编辑组</td>
                        <td>是</td>
                        <td> <span class="statusok">正常</span> </td>
                        <td> <span class="iconfont icon-bianji"></span> <span class="iconfont icon-shanchu
                            "></span></td>
                    </tr>
                    <tr>
                        <td class="email">123123123@qq.com</td>
                        <td>李彦慧</td>
                        <td>13611129070</td>
                        <td>编辑组</td>
                        <td>是</td>
                        <td> <span class="statusok">正常</span> </td>
                        <td> <span class="iconfont icon-bianji"></span> <span class="iconfont icon-shanchu
                            "></span> </td>
                    </tr>
                </tbody>
            </table>
            <div class="foot">
                <div class="prev">上一页</div>
                <div class="next">下一页</div>
            </div>
            
        </div>
    </div>

</body>

</html>
<script src="./ajax-promise.js"></script>
<script src="./mock源码.js"></script>
<script src="./mockdata.js"></script>
<script>
    // 渲染表格数据
    render(data.list)
    function render(data){
        var str = data.map((item,index)=>{
            return `<tr>
                        <td class="email">${item.email}</td>
                        <td>${item.name}</td>
                        <td>${item.phone}</td>
                        <td>${item.ingroup}</td>
                        <td>${item.isadmin}</td>
                        <td> <span class="statusok">${item.status}</span> </td>
                        <td> <span class="iconfont icon-bianji"></span> <span class="iconfont icon-shanchu
                            "></span></td>
                    </tr>`
        }).join('')
        document.querySelector('tbody').innerHTML = str;
    }
</script>